<div class="players view">
<h2>
<?php
	__('Player');
	echo ': '.$player['Player']['strName'].' ';
	if($player['Player']['bStar'] == 1) {
	   echo $html->image('star_small.jpg', array('alt' => 'Is Star'));
	}
	if($player['Player']['bDead'] == 1) {
	   echo $html->image('dead_small.png', array('alt' => 'Is Dead'));
	}
	echo ' - #'.$player['Player']['iNumber'];
?>
</h2>
	<dl><?php $i = 0; $class = ' class="altrow"';?>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Player Type'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $html->link($player['PlayerType']['LocalizedString'][$locale], array('controller' => 'player_types', 'action' => 'view', $player['PlayerType']['ID'])); ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Team'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $html->link($player['Team']['strName'], array('controller' => 'teams', 'action' => 'view', $player['Team']['ID'])); ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Race'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $html->link($player['Race']['LocalizedString'][$locale], array('controller' => 'races', 'action' => 'view', $player['Race']['ID'])); ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Characteristics'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<table>
				<tr>
					<th><?php  __('M');?></th>
					<th><?php  __('S');?></th>
					<th><?php  __('A');?></th>
					<th><?php  __('Ar');?></th>
					<th><?php  __('XP');?></th>
					<th><?php  __('Val');?></th>
					<th><?php  __('State');?></th>
				</tr>
				<tr>
					<td><?php echo $player['Player']['Characteristics_fMovementAllowance']; ?></td>
					<td><?php echo $player['Player']['Characteristics_fStrength']; ?></td>
					<td><?php echo $player['Player']['Characteristics_fAgility']; ?></td>
					<td><?php echo $player['Player']['Characteristics_fArmourValue']; ?></td>
					<td><?php echo $player['Player']['iExperience']; ?></td>
					<td><?php echo $player['Player']['iValue']; ?></td>
					<td><?php
						if($player['Player']['iMatchSuspended'] == 1) {
							echo 'MNG';
						}
						?>
				</tr>
			</table>

			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Player Level'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $html->link($player['PlayerLevel']['LocalizedString'][$locale], array('controller' => 'player_levels', 'action' => 'view', $player['PlayerLevel']['ID'])); ?>
			&nbsp;
		</dd>
	</dl>
</div>
<div class="actions">
	<ul>
		<li><?php echo $html->link(__('Delete Player', true), array('action' => 'delete', $player['Player']['ID']), null, sprintf(__('Are you sure you want to delete # %s?', true), $player['Player']['ID'])); ?> </li>
		<li><?php echo $html->link(__('List Players', true), array('action' => 'index')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php __('Player Skills');?></h3>
	<?php if (!empty($player['Skill'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Name'); ?></th>
		<th><?php __('Description'); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($player['Skill'] as $playerSkill):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $playerSkill['LocalizedString'][$locale];?></td>
			<td><?php echo $playerSkill['FormattedString'][$locale];?></td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $html->link(__('New Player Skill', true), array('controller' => 'player_skills', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php __('Related Player Statistics');?></h3>
	<?php if (!empty($player['StatisticsPlayer'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Id'); ?></th>
		<th><?php __('Player Id'); ?></th>
		<th><?php __('IMatchPlayed'); ?></th>
		<th><?php __('IMVP'); ?></th>
		<th><?php __('Inflicted IPasses'); ?></th>
		<th><?php __('Inflicted ICatches'); ?></th>
		<th><?php __('Inflicted IInterceptions'); ?></th>
		<th><?php __('Inflicted ITouchdowns'); ?></th>
		<th><?php __('Inflicted ICasualties'); ?></th>
		<th><?php __('Inflicted ITackles'); ?></th>
		<th><?php __('Inflicted IKO'); ?></th>
		<th><?php __('Inflicted IStuns'); ?></th>
		<th><?php __('Inflicted IInjuries'); ?></th>
		<th><?php __('Inflicted IDead'); ?></th>
		<th><?php __('Inflicted IMetersRunning'); ?></th>
		<th><?php __('Inflicted IMetersPassing'); ?></th>
		<th><?php __('Sustained IInterceptions'); ?></th>
		<th><?php __('Sustained ICasualties'); ?></th>
		<th><?php __('Sustained ITackles'); ?></th>
		<th><?php __('Sustained IKO'); ?></th>
		<th><?php __('Sustained IStuns'); ?></th>
		<th><?php __('Sustained IInjuries'); ?></th>
		<th><?php __('Sustained IDead'); ?></th>
		<th><?php __('Calendar Id'); ?></th>
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($player['PlayerSeasonStatistic'] as $StatisticsPlayer):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $StatisticsPlayer['ID'];?></td>
			<td><?php echo $StatisticsPlayer['player_id'];?></td>
			<td><?php echo $StatisticsPlayer['iMatchPlayed'];?></td>
			<td><?php echo $StatisticsPlayer['iMVP'];?></td>
			<td><?php echo $StatisticsPlayer['Inflicted_iPasses'];?></td>
			<td><?php echo $StatisticsPlayer['Inflicted_iCatches'];?></td>
			<td><?php echo $StatisticsPlayer['Inflicted_iInterceptions'];?></td>
			<td><?php echo $StatisticsPlayer['Inflicted_iTouchdowns'];?></td>
			<td><?php echo $StatisticsPlayer['Inflicted_iCasualties'];?></td>
			<td><?php echo $StatisticsPlayer['Inflicted_iTackles'];?></td>
			<td><?php echo $StatisticsPlayer['Inflicted_iKO'];?></td>
			<td><?php echo $StatisticsPlayer['Inflicted_iStuns'];?></td>
			<td><?php echo $StatisticsPlayer['Inflicted_iInjuries'];?></td>
			<td><?php echo $StatisticsPlayer['Inflicted_iDead'];?></td>
			<td><?php echo $StatisticsPlayer['Inflicted_iMetersRunning'];?></td>
			<td><?php echo $StatisticsPlayer['Inflicted_iMetersPassing'];?></td>
			<td><?php echo $StatisticsPlayer['Sustained_iInterceptions'];?></td>
			<td><?php echo $StatisticsPlayer['Sustained_iCasualties'];?></td>
			<td><?php echo $StatisticsPlayer['Sustained_iTackles'];?></td>
			<td><?php echo $StatisticsPlayer['Sustained_iKO'];?></td>
			<td><?php echo $StatisticsPlayer['Sustained_iStuns'];?></td>
			<td><?php echo $StatisticsPlayer['Sustained_iInjuries'];?></td>
			<td><?php echo $StatisticsPlayer['Sustained_iDead'];?></td>
			<td><?php echo $StatisticsPlayer['calendar_id'];?></td>
			<td class="actions">
				<?php echo $html->link(__('View', true), array('controller' => 'player_statistics', 'action' => 'view', $StatisticsPlayer['ID'])); ?>
				<?php echo $html->link(__('Edit', true), array('controller' => 'player_statistics', 'action' => 'edit', $StatisticsPlayer['ID'])); ?>
				<?php echo $html->link(__('Delete', true), array('controller' => 'player_statistics', 'action' => 'delete', $StatisticsPlayer['ID']), null, sprintf(__('Are you sure you want to delete # %s?', true), $StatisticsPlayer['ID'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $html->link(__('New Player Statistic', true), array('controller' => 'player_statistics', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
